#include <wiringPi.h>
#define led_wirPIn 29     // 定义 排针的第40引脚接LED正极
#define button_wirPIn 28  // 定义 排针的第38引脚接按钮

int main (void)
{
    wiringPiSetup () ;
    pinMode (led_wirPIn, OUTPUT);
    digitalWrite (led_wirPIn, LOW);
    pinMode (button_wirPIn, INPUT); // 设置按钮引脚为输入
    pullUpDnControl (button_wirPIn, PUD_UP); // 接按钮的引脚设置成上拉
    while(1){
      if(digitalRead(button_wirPIn) == 0){ // 检测到低电平
        delay(20); // 延时销抖
        if(digitalRead(button_wirPIn) == 0){ // 检测到低电平
          digitalWrite (led_wirPIn, HIGH);  // 点亮LED
        }
      }else{
        digitalWrite (led_wirPIn, LOW); // 没检测到 按钮按下动作
      }
    }
	return 0;
}
